<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /*  在chrome浏览器  outline 会有一个黑色的框，一般需要清除 */
        input{border:1px solid #ccc; outline: none;}
    </style>
</head>
<body>
    <input type="text"  placeholder="邮箱/ID/手机号" />

    <script>
        //1.获取 事件源
        var oInput = document.querySelector("input");
        //2.绑定
        //文本框获取焦点的事件
        oInput.onfocus = function(){
            this.style.border="1px solid #ffd6db";
        }
        oInput.onblur = function(){
            this.style.border="1px solid #ccc";
        }
    </script>
</body>
</html>